package com.freedy.concurrent.javaThread.cycle;

/**
 * 在循环中，防止cpu占到100%
 *
 * @author Freedy
 * @date 2021/4/20 17:43
 */
public class Test {
    public static void main(String[] args) {
        //通过sleep实现
        while (true) {
            try {
                Thread.sleep(50);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }
}
